package itsm.isperp.module.repository.project;

import itsm.isperp.framework.data.domain.DataRequest;
import itsm.isperp.framework.data.domain.DataResponse;
import itsm.isperp.framework.data.mybatis.dao.CUDMapper;
import itsm.isperp.module.entity.app.AppUser;
import itsm.isperp.module.entity.project.ProjProject;
import itsm.isperp.module.entity.project.ProjProjectMember;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

/**
 * 项目人员数据映射器
 * 
 * @author lizx
 * @date 2013-3-25
 * @version V1.0
 */
@Repository
public interface ProjProjectMemberMapper extends CUDMapper<ProjProjectMember> {

	/**
	 * 获取项目组人员列表
	 * 
	 * @param projectId
	 *            项目Id
	 * @return 项目人员列表
	 */
	List<ProjProjectMember> findAllByProjectId(
			@Param("projectId") String projectId);

	/**
	 * 查询项目用户
	 * 
	 * @param projectId
	 *            项目Id
	 * @return 项目用户列表
	 */
	List<Map<String, Object>> findAllMemberByProjectId(
			@Param("projectId") String projectId,
			@Param("userProcessSql") String userProcessSql);

	/**
	 * 
	 * @param req
	 * @return
	 */
	DataResponse<ProjProject> findMemberProjects(DataRequest req);

	/**
	 * 查询项目可选的人员
	 * 
	 * @param projectId
	 *            项目Id
	 * @param req
	 *            数据请求{@link DataRequest}
	 * @return 目关联服务实体列表 {@link VProjProjectMember}
	 */
	public DataResponse<Map<String, Object>> findAllDetailOptionalByRequest(
			String projectId, DataRequest req);

	public DataResponse<Map<String, Object>> findDetailByProjectId(
			String projectId, DataRequest req);

	public List<AppUser> findMemberUserByProjectIdAndRole(
			@Param("projectId") String projectId, @Param("roleId") String roleId);

}
